﻿@model IEnumerable<ScrumProject.Models.Story>

@{
    ViewBag.Title = "Index";
}

<h2>Stories</h2>

<p>
    @Html.ActionLink("Create New", "Create", new { projectId = ViewBag.projectId })
</p>
<table class="table" style="border: 1px solid #CFCACC;">
    <tr>
        <th></th>
        <th>
            Name
        </th>
        <th>
            Description
        </th>
        <th>
            Tests
        </th>
        <th>
            Priority
        </th>
        <th>
            BusinessValue
        </th>
       @* <th>
            Status
        </th>*@
        <th>
            Notes
        </th>
        @*<th>
            Project
        </th>*@
        <th></th>
        <th>Tasks</th>
        <th></th>
    </tr>


@foreach (var item in Model)
{   
    
    
    
    <tr>
        <td>
           @* <input type="checkbox" name="id" value="@item.Id" />*@
        </td>
        <td><center>
            @Html.DisplayFor(modelItem => item.Name)</center>
        </td>
        <td style="display: table-cell; width: 30%"><span style="display: block; "><center>
            @Html.DisplayFor(modelItem => item.Description)</center>
        </span></td>
        <td><center>
            @Html.DisplayFor(modelItem => item.Tests)</center>
        </td>
        <td><center>
            @Html.DisplayFor(modelItem => item.Priority)</center>
        </td>
        <td><center>
            @Html.DisplayFor(modelItem => item.BusinessValue)</center>
        </td>
        @*<td><center>
            @Html.DisplayFor(modelItem => item.Status)</center>
        </td>*@
        <td><center>
            @Html.DisplayFor(modelItem => item.Notes)</center>
        </td>
        @*<td>
        @using(Html.BeginForm("SaveEs", "Story",FormMethod.Post))
       {

            <form action="/Story/SaveEs" method="get">

	        <fieldset>
            <center>
             @Html.HiddenFor(modelItem => item.Id)
            @Html.TextBoxFor(modelItem => item.TimeComplexity, new { style = "width: 35px;" })
            <div id="item-post" >
                    <input title="save" type="submit" value="save" class="btn" />
                </div></center>
                </fieldset></form>
       }
        </td>*@
       @* <td><center>
            @Html.DisplayFor(modelItem => item.Project.Name)</center>
        </td>*@
        
        <td>
            @Html.ActionLink("Edit", "Edit", new { id = item.Id })|
            @Html.ActionLink("Notes", "Notes", new { id = item.Id }) |
            @Html.ActionLink("Details", "Details", new { id = item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.Id })
        </td>
        <td><center>
            @Html.ActionLink("Manage Tasks", "Index", "Task", new { storyId = item.Id }, null)
            </center>
        </td>
        @*<td>

            <input type="button" id="accept" value="Accept" class="btn" />
        </td>*@
    </tr>
    
}

</table>
<br />
<div>
   @* <input type="button" id="chk" class="btn" value="Save time Estimates" onclick="location.href='@Url.Action("SaveEs", "Index", new { id = ViewBag.projectId })'"/>*@
</div>
<div id="result">
</div> 
<div>
    @Html.ActionLink("Back to Project", "Details", "Project", new { id = ViewBag.projectId }, null)
</div>
